<?php
class XistsChangePasswordForm extends sfForm
{
  public function configure()
  {

	$this->validatorSchema->setOption('allow_extra_fields', true);

    $this->setWidgets(array(
      'current_password' => new sfWidgetFormInputPassword(),
      'new_password' => new sfWidgetFormInputPassword(),
      'confirm_password' => new sfWidgetFormInputPassword()
    ));
    
    $this->setValidators(array(
      'current_password' => new sfValidatorString(array('required' => true)),
      'new_password' => new sfValidatorString(array('required' => true)),
      'new_password' => new sfValidatorString(array('min_length' => 4)),
      'confirm_password' => new sfValidatorString(array('required' => true)),
      'confirm_password' => new sfValidatorString(array('min_length' => 4)),
    ));
    
    $this->widgetSchema->setNameFormat('change[%s]');
  }
}
